#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>



int main(int argc, char *argv[]){
	struct gameState *state = newGame();
	int *bonus = malloc(sizeof(int));
	int i;
//test1
	state->handCount[0] = 1;
	state->hand[0][0] = steward;
	state->handCount[0] = 3;
	state->hand[0][1] = 0;
	state->hand[0][2] = 0;
        state->numPlayers = 2;
        state->whoseTurn = 0;
        state->numActions = 1;
        state->deckCount[0] = 10;
        state->discardCount[0] = 0;
	state->coins = 0;
        for(i = 0; i<10;i++){
                state->supplyCount[i] = i+7;
                state->deck[0][i] = i;
	}
	cardEffect(steward,1,2,3,state,0,bonus);

	if(state->handCount[0] == 4 && state->coins == 0){
		printf("steward PASSED on choice 1 = 1.\n");
	}
	else{
		printf("steward FAILED on choice 1 = 1 .\n");
	}
	printf("handcount=%d coins=%d.\n", state->handCount[0],state->coins);
//test2
	state->handCount[0] = 1;
	state->hand[0][0] = steward;
	state->handCount[0] = 3;
	state->hand[0][1] = 0;
	state->hand[0][2] = 0;
        state->numPlayers = 2;
        state->whoseTurn = 0;
        state->numActions = 1;
        state->deckCount[0] = 10;
        state->discardCount[0] = 0;
	state->coins = 0;
        for(i = 0; i<10;i++){
                state->supplyCount[i] = i+7;
                state->deck[0][i] = i;
	}
	cardEffect(steward,2,2,3,state,0,bonus);

	if(state->handCount[0] == 2 && state->coins == 2){
		printf("steward PASSED on choice 1 = 2.\n");
	}
	else{
		printf("steward FAILED on choice 1 = 2");
	}
	printf("handcount=%d coins=%d.\n", state->handCount[0],state->coins);
//test 3
	state->handCount[0] = 1;
	state->hand[0][0] = steward;
	state->handCount[0] = 3;
	state->hand[0][1] = 0;
	state->hand[0][2] = 0;
        state->numPlayers = 2;
        state->whoseTurn = 0;
        state->numActions = 1;
        state->deckCount[0] = 10;
        state->discardCount[0] = 0;
	state->coins = 0;
        for(i = 0; i<10;i++){
                state->supplyCount[i] = i+7;
                state->deck[0][i] = i;
	}
	cardEffect(steward,0,2,3,state,0,bonus);

	if(state->handCount[0] == 0 && state->coins == 0){
		printf("steward PASSED on choice 1 = 0.\n");
	}
	else{
		printf("steward FAILED on choice 1 = 0");
	}
	printf("handcount=%d coins=%d.\n", state->handCount[0],state->coins);
	return 0;
}
